package com.gryffonx.NameGenerators;

import com.gryffonx.utils.StringUtils;
import com.gryffonx.utils.XMLUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

import java.io.File;

/**
 * **************************************************************************
 * Application:
 * Author: Erik Stell
 * Date: Feb 8, 2005
 * Time: 12:20:19 PM
 * Process:
 * **************************************************************************
 */
public class TimelineEventGenerator {
    private static final File fileToBeParsed = new File("src/com/gryffonx/xml/timeline.xml");
    private static final SAXReader reader = new SAXReader();
    private static Document xmlDoc = null;

    public static String generateEvent() {
        String retVal;

        try {
            xmlDoc = reader.read(fileToBeParsed);
        } catch (DocumentException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

        retVal = (StringUtils.capitalize(XMLUtils.getNodeValue("timeline", xmlDoc, 1)));

        return retVal;

    }
}
